3cfc62ed5596f286f07eff4d85cf16ad040f14c3,xwiki-platform-web/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/client/editor/WysiwygEditorListener.java,WysiwygEditorListener,onTabSelected,#SourcesTabEvents#number#,170

Before Change


        editor.setLoading(true);
        if (index == WysiwygEditor.WYSIWYG_TAB_INDEX) {
            WysiwygServiceAsync wysiwygService = WysiwygService.Singleton.getInstance();
            wysiwygService.toHTML(editor.getPlainTextEditor().getText(), editor.getConfig().getParameter(
                SYNTAX_CONFIG_PARAMETER, WysiwygEditor.DEFAULT_SYNTAX), new SwitchToWysiwygCallback(editor));
        } else {
            WysiwygServiceAsync wysiwygService = WysiwygService.Singleton.getInstance();

After Change


        WysiwygServiceAsync wysiwygService = WysiwygService.Singleton.getInstance();
        // We test if the RTE textarea is disabled to be sure that the editor is not already being switched.
        if (index == WysiwygEditor.WYSIWYG_TAB_INDEX && !editor.getRichTextEditor().getTextArea().isEnabled()) {
            wysiwygService.toHTML(editor.getPlainTextEditor().getTextArea().getText(), editor.getConfig().getParameter(
                SYNTAX_CONFIG_PARAMETER, WysiwygEditor.DEFAULT_SYNTAX), new SwitchToWysiwygCallback(editor));
        } else {
            // We test if the RTE textarea is enabled to be sure that the editor is not already being switched.